package com.estate.system.domain.report.saledepartmentmanager.departmentanalysis;

import lombok.Data;
import lombok.ToString;

// GMV趋势数据点
@Data
@ToString
public class GmvTrendPoint {
    private String dayOfWeek; // 星期几缩写：S, M, T, W, T, F, S
    private String fullDayName; // 完整的星期几名称
    private double curve1Value; // 曲线1的值（黑色曲线）
    private double curve2Value; // 曲线2的值（灰色曲线）
    
    public GmvTrendPoint(String dayOfWeek, String fullDayName, double curve1Value, double curve2Value) {
        this.dayOfWeek = dayOfWeek;
        this.fullDayName = fullDayName;
        this.curve1Value = curve1Value;
        this.curve2Value = curve2Value;
    }

    // 获取两条曲线的差值
    public double getDifference() {
        return curve1Value - curve2Value;
    }
    
    // 获取波动率（曲线1相对于曲线2的波动百分比）
    public double getVolatilityPercentage() {
        if (curve2Value == 0) return 0;
        return ((curve1Value - curve2Value) / curve2Value) * 100;
    }
}